﻿using System.Windows.Controls;
using System.Windows.Data;

namespace ZipSpace
{
	public partial class ZipDataGrid : DataGrid
	{
		public ZipDataGrid()
		{
			InitializeComponent();

			CollectionViewSource source = this.Resources["source"] as CollectionViewSource;

			this.ItemsSource = source.View;
		}

		public new object DataContext
		{
			get
			{
				return base.DataContext;
			}

			set
			{
				base.DataContext = value;

				CollectionViewSource source = this.Resources["source"] as CollectionViewSource;

				source.Source = value;

				this.ItemsSource = source.View;
			}
		}
	}
}